package uitest
{
	import flash.display.Sprite;
	import iscript.gameFramework.GameLite.events.KeyInputEvent;
	import iscript.gameFramework.GameLite.Game;
	import iscript.uiFramework.components.silder.BaseSilder;
	import iscript.uiFramework.components.silder.ISilder;
	import iscript.uiFramework.components.silder.SilderBar;
	import iscript.uiFramework.components.silder.SilderType;
	import iscript.uiFramework.event.SilderEvent;
	
	public class SilderTest extends Sprite
	{
		//public var silder:BaseSilder = new BaseSilder ();
		
		[Embed(source="../../bin/map.jpg")]
		private var map:Class;
		
		//public var silder:BaseSilder = new BaseSilder();
		public var silder:SilderBar = new SilderBar();
	 	
		public function SilderTest()
		{
		 
			
			for (var i:int = 0; i < 1; i++)
			{
				//var silder:BaseSilder = new BaseSilder ();
				//	var silder:SilderBar = new SilderBar();
				// 	silder.visible = false;
				silder.type = SilderType.Vertical;
				silder.minValue = 80;
				silder.maxValue = 200;
				silder.width = 200;
				silder.addEventListener(SilderEvent.DRAGING, dragging)
				//silder.inner = true;
				//	var bm:Bitmap = new Bitmap(UIFramework.resource.getBitmapData("GameLite.UIComponent.DefaultTheme.SilderBar.Down"))
				//bm.x = -bm.width/2
				//	if (i == 0) silder.setBlock(bm);
				if (i == 1)
					silder.type = SilderType.Vertical;
				silder.render(this);
				//trace(silder.width, silder.height,silder.currentValue,silder.progress)
				//silder.width = 10;
				trace(silder.width)
			 
				//silder.border = true;
				
			 
			}
			
			Game.keyInput.addEventListener(KeyInputEvent.RELEASEKEYGROUP, releaseKeyGrooup);
		
		}
		
		private function releaseKeyGrooup(e:KeyInputEvent):void
		{
			trace(e.keysIntValue)
			if (Game.keyInput.matchKeyGroupData(e.keyGroupData, "38"))
			{
				//silder.currentValue = 300;
				//
				silder.theme = "BlueTheme"
					//trace("38",silder.currentValue)
			}
		
		/*    if (Game.keyInput.matchKeyGroupData (e.keyGroupData, "37")) {
		   silder.currentValue-=10
		   trace("37",silder.currentValue)
		   }
		
		   if (Game.keyInput.matchKeyGroupData(e.keyGroupData, "39")) {
		   silder.currentValue+=10
		   trace("37",silder.currentValue)
		   }
		   //	silder.x += 10;;
		 trace (silder.width, silder.height);*/
		}
		
		private function dragging(e:SilderEvent):void
		{
			//BaseSilder (e.target).progress = 0.3;
			 trace(ISilder(e.target).currentValue, ISilder(e.target).progress, ">>>>>>>>>>>");
			//trace (BaseSilder (e.target).currentValue,BaseSilder (e.target).progress,">>>>>>>>>>>");
		}
	
	}

}